package simplexrevisado;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * 
 */
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;


public class Srev extends JFrame{
    public Srev(int n, int r){
    super("METODO SIMPLEX REVISADO");
    Container c =getContentPane();
    c.setLayout(new GridLayout(r,n));
    //Layout p=new GridLayout(r,n);
    
    JPanel prin [][]= new JPanel[r][n];
    JTextField  ma[][] = new  JTextField[r][n];
    JLabel x[][]=new JLabel[r][n];
    
    for (int i=0; i<r; i++){
            for (int j=0; j<n; j++){
             
                ma[i][j] = new JTextField();
                ma[i][j].setText("           ");
                c.add(ma[i][j]);
                int k=j+1;
                x[i][j] = new JLabel("X"+k);
                c.add(x[i][j]);
            }
        }
   
    
       setSize(400,400);
       setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
       setVisible(true); 
       setResizable(true);
    
    }

public static void main(String[] args) {
       
      String re=JOptionPane.showInputDialog("Ingresa el numero de restricciones");
      String nu=JOptionPane.showInputDialog("Ingresa el numero de variables de decision");
      int r = Integer.parseInt(re);
      int n = Integer.parseInt(nu);
      new Srev(n,r);
      
}
}